export default {
  routes: [
    // 后台首页
    {
      path: '/dashboard',
      meta: { name: '首台首页', icon: 'icon-shouye' },
      component: () =>
        import(/* webpackChunkName: "login" */ '../views/Dashboard/index.vue')
    },
    // 订单管理
    {
      path: '/order',
      meta: {
        name: '订单管理',
        role: ['super', 'normal'],
        icon: 'icon-icon-'
      },
      component: () =>
        import(/* webpackChunkName: "login" */ '../views/Order/index.vue')
    },
    // 商品管理
    {
      path: '/pro',
      meta: { name: '商品管理', icon: 'icon-shangpin' },
      redirect: '/pro/list',
      component: () =>
        import(/* webpackChunkName: "login" */ '../views/Product/index.vue'),
      children: [
        {
          path: '/pro/list',
          meta: { name: '商品列表' },
          component: () =>
            import(
              /* webpackChunkName: "login" */ '../views/Product/ProList.vue'
            )
        },
        {
          path: '/pro/add',
          meta: { name: '商品添加' },
          component: () =>
            import(
              /* webpackChunkName: "login" */ '../views/Product/ProAdd.vue'
            )
        },
        {
          path: '/pro/cate',
          meta: { name: '商品分类' },
          component: () =>
            import(
              /* webpackChunkName: "login" */ '../views/Product/ProCate.vue'
            )
        },
        {
          path: '/pro/edit/:id',
          hidden: true,
          meta: { name: '商品编辑' },
          component: () =>
            import(
              /* webpackChunkName: "login" */ '../views/Product/ShopEdit.vue'
            )
        }
      ]
    },
    // 店铺管理
    {
      path: '/shop',
      meta: { name: '店铺管理', role: ['super'], icon: 'icon-dianpu ' },
      component: () =>
        import(/* webpackChunkName: "login" */ '../views/Shop/index.vue')
    },
    // 账号管理
    {
      path: '/account',
      meta: {
        name: '账号管理',
        role: ['super', 'normal'],
        icon: 'icon-zhanghao'
      },
      redirect: '/account/list',
      component: () =>
        import(/* webpackChunkName: "login" */ '../views/Account/index.vue'),
      children: [
        {
          path: '/account/list',
          meta: { name: '账号列表', role: ['super'] },
          component: () =>
            import(
              /* webpackChunkName: "login" */ '../views/Account/AccountList.vue'
            )
        },
        {
          path: '/account/add',
          meta: { name: '添加账号', role: ['super'] },
          component: () =>
            import(
              /* webpackChunkName: "login" */ '../views/Account/AccountAdd.vue'
            )
        },
        {
          path: '/account/reset',
          meta: { name: '修改密码' },
          component: () =>
            import(
              /* webpackChunkName: "login" */ '../views/Account/ResetPwd.vue'
            )
        },
        {
          path: '/account/info',
          hidden: true,
          meta: { name: '个人中心' },
          component: () =>
            import(
              /* webpackChunkName: "login" */ '../views/Account/Presonal.vue'
            )
        }
      ]
    },
    // 销售统计
    {
      path: '/sell',
      meta: { name: '销售统计', role: ['super'], icon: 'icon-tongji' },
      redirect: '/sell/goods',
      component: () =>
        import(/* webpackChunkName: "login" */ '../views/SellCount/index.vue'),
      children: [
        {
          path: '/sell/goods',
          meta: { name: '商品统计' },
          component: () =>
            import(
              /* webpackChunkName: "login" */ '../views/SellCount/GoodsCount.vue'
            )
        },
        {
          path: '/sell/orders',
          meta: { name: '订单统计' },
          component: () =>
            import(
              /* webpackChunkName: "login" */ '../views/SellCount/OrdersCount.vue'
            )
        }
      ]
    }
  ]
}
